package com.ruicar.afs.cloud.parameter.commom.enums;

import lombok.Getter;

/**
 * @description: 车辆类型枚举
 * @author: sijun.yu
 * @date: 2020/5/13 14:46
 */
@Getter
public enum CarType {

    PASSENGER_CAR("00", "乘用车"),
    LCV("01", "LCV"),
    MIDDLE_CAD("02", "中卡"),
    COMMERCIAL_CAR("03", "重卡");

    private final String index;
    private final String name;

    private CarType(String index, String name) {
        this.index = index;
        this.name = name;
    }

    public static String getName(String index) {
        for (CarType carType : CarType.values()) {
            if (carType.getIndex().equals(index)) {
                return carType.getName();
            }
        }
        return null;
    }

}
